﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="userlist.aspx.cs" Inherits="UI.system.page.news.userlist" %>

    <script src="/system/js/jquery.min.js"></script>
    <script src="/system/layui/layui.js"></script>
    <script src="/system/layui/lay/modules/laydate.js"></script>
    <script src="/system/js/common.js"></script>
    <script src="/system/js/md5.js"></script>
    <script src="../../js/swfupload.js" type="text/javascript"></script>
    <link rel="stylesheet" href="/system/layui/css/layui.css">
    <link rel="stylesheet" href="/system/css/iframe.css">
    <script src="/js/clipboard.min.js"></script>

<style>
    .layui-searchbar .left
    {
        margin-left: 5px;
    }
    .layui-searchbar .right
    {
        margin-right: 5px;
    }
    .layer-page{bottom:0!important;}
    .layui-form{padding-bottom:21px}
    .layui-btn-sm {height:30px;line-height:30px; padding:0 10px;}
</style>
    <div class="layui-form" style="float:left; width:100%; background:#fff;">
        <div class="layui-searchbar">
            <div class="left"><div class="layui-input-inline"><a class="layui-btn layui-btn-sm layui-btn-normal" data-type="getCheckData" onclick="confirms()">确认选择</a></div></div>
            <div class="right"><div class="layui-input-inline" style="margin-right:5px;"><input id="keyword" type="text" name="name" placeholder="用户名、手机号"  class="layui-input" value="" style="height:30px; line-height:30px;"></div><div class="layui-input-inline"><a class="layui-btn layui-btn-small" onclick="Search()">搜索</a></div></div>
        </div>
        <div>
            <table lay-data="{id:'mytable'}" class="layui-table">
                <colgroup>
                    <col>
                    <col>
                    <col>
                    <col>
                    <col>
                    <col>
                </colgroup>
                <thead>
                    <tr>
                        <th>
                            选择
                        </th>
                        <th>
                            头像
                        </th>
                        <th>
                            用户名
                        </th>
                        <th>
                            电话
                        </th>
                        <th>
                            余额
                        </th>
                        <th>
                            省市区
                        </th>
                        <th>
                            创建时间
                        </th>
                    </tr>
                </thead>
                <tbody id="layer-table">
                    <tr>
                        <td colspan="20" class="center">
                            数据加载中...
                        </td>
                    </tr>
                </tbody>
                <script id="data-table" type="text/html">
             {{#  layui.each(d, function(index, item){ }}
              <tr>
                <td><input type="radio" name="userinfo" title=" " value="{{item.ID}}|{{item.NickName}}|{{item.HeadImg}}"></td>
                <td><img src={{item.HeadImg}} height="40px"/></td>
                <td>{{item.NickName}}</td>
                <td>{{item.Mobile}}</td>
                <td>{{item.Money}}</td>
                <td>{{item.Province}}-{{item.City}}-{{item.Area}}</td>
                <td>{{item.CreateDate}}</td>
              </tr>
              {{#  }); }}
                </script>
            </table>
    </div>
    <div id="layer-page" class="layer-page">
</div>


<script>
    layui.use(["form", "laydate"], function () {
        var $ = layui.jquery, form = layui.form, laydate = layui.laydate;
        Init_Pager(1);
    });
    function Init_Pager(pageindex) {
        var data = {};
        data.act = "Find_User";
        data.keyword = $("#keyword").val();
        data.pageindex = pageindex;
        data.state = -2;
        data.sign = GetSign(data);
        Ajax.Post("/tools/Admin.ashx", data, function (r) {
            var json = $.parseJSON(r);
            if (json.state) {
                Pager(json.data.list, json.data.count);
            }
            else {
                LayerBox.Error(json.msg);
            }
        });
    };
    function confirms() {    //点击确认
        var userId = ''; //用户id
        var userName = ''; //用户昵称
        var userHeadImg = ''; //用户头像
        $("input:radio[name='userinfo']:checked").each(function () { // 遍历name=videoid的值
            var values = $(this).val();
            userId = values.split('|')[0];
            userName = values.split('|')[1];
            userHeadImg = values.split('|')[2];
        });
        window.parent.$("#username").val(userName);
        window.parent.$("#headimg").val(userHeadImg);
        window.parent.$("#userid").val(userId); 
        LayerBox.Close.ByIndex(window.parent.userlist);
    }
</script>